-- GENERATED SPELL FOR [Unliving Sorcerer] --


function spell0_18499(pUnit, Event) --@Blast Wave,Self--
pUnit:FullCastSpellOnTarget(15744,pUnit)
pUnit:RegisterEvent('Sorts_18499', 6295, 1)
end

function spell1_18499(pUnit, Event) --@Blast Wave,Self--
pUnit:FullCastSpellOnTarget(22424,pUnit)
pUnit:RegisterEvent('Sorts_18499', 6344, 1)
end

function spell2_18499(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(12466,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18499', 3000, 1)
end

function spell3_18499(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(17290,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18499', 3000, 1)
end

function spell4_18499(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(15043,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18499', 7000, 1)
end

function spell5_18499(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(15530,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18499', 7000, 1)
end

function Sorts_18499(pUnit, Event)
local choix_sorts_18499 = math.random(0, 5)
if choix_sorts_18499 == 0 then
pUnit:RegisterEvent('spell0_18499', 1, 1)
end
if choix_sorts_18499 == 1 then
pUnit:RegisterEvent('spell1_18499', 1, 1)
end
if choix_sorts_18499 == 2 then
pUnit:RegisterEvent('spell2_18499', 1, 1)
end
if choix_sorts_18499 == 3 then
pUnit:RegisterEvent('spell3_18499', 1, 1)
end
if choix_sorts_18499 == 4 then
pUnit:RegisterEvent('spell4_18499', 1, 1)
end
if choix_sorts_18499 == 5 then
pUnit:RegisterEvent('spell5_18499', 1, 1)
end
end

function mob18499_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18499', math.random(1500, 3000), 1)
end

function mob18499_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18499_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18499_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18499, 1, 'mob18499_Action')
RegisterUnitEvent(18499, 2, 'mob18499_Leave')
RegisterUnitEvent(18499, 3, 'mob18499_Kill')
RegisterUnitEvent(18499, 4, 'mob18499_Die')
